Drop gtk_get_main_thread
authorMatthias Clasen <mclasen@redhat.com>
Mon, 10 Feb 2020 03:37:18 +0000 (22:37 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 10 Feb 2020 04:13:13 +0000 (23:13 -0500)
This is not a very useful api, and if you need it,
you can just as easily keep track yourself which thread
called gtk_init().

gtk/gtkmain.c
gtk/gtkmain.h
testsuite/gtk/main.c

index 33fccd8a8072dc8ab49b73de9430fd8bf4f6f102..baa486593d14bb87b0a47a961cfc0466f9202f29 100644 (file)
@@ -142,7 +142,6 @@ static GtkWindowGroup *gtk_main_get_window_group (GtkWidget   *widget);
 static gint pre_initialized = FALSE;
 static gint gtk_initialized = FALSE;
 static GList *current_events = NULL;
-static GThread *initialized_thread = NULL;
 
 typedef struct {
   GdkDisplay *display;
@@ -801,8 +800,6 @@ gtk_init_check (void)
   do_pre_parse_initialization ();
   do_post_parse_initialization ();
 
-  initialized_thread = g_thread_self ();
-
   ret = gdk_display_open_default () != NULL;
 
   if (ret && (gtk_get_debug_flags () & GTK_DEBUG_INTERACTIVE))
@@ -927,19 +924,6 @@ gtk_is_initialized (void)
   return gtk_initialized;
 }
 
-/**
- * gtk_get_main_thread:
- *
- * Get the thread from which GTK was initialized.
- *
- * Returns: (transfer none): The #GThread initialized for GTK, must not be freed
- */
-GThread *
-gtk_get_main_thread (void)
-{
-  return initialized_thread;
-}
-
 
 /**
  * gtk_get_locale_direction:
index dd5e5479535efc4e1639f6854212f43604d4eb1c..34bdfb564146b8606f4bf15d87ea4e36e829e533 100644 (file)
@@ -81,9 +81,6 @@ gboolean gtk_init_check           (void);
 GDK_AVAILABLE_IN_ALL
 gboolean gtk_is_initialized       (void);
 
-GDK_AVAILABLE_IN_ALL
-GThread * gtk_get_main_thread     (void);
-
 #ifdef G_OS_WIN32
 
 /* Variants that are used to check for correct struct packing
index cdfd4d058d91ca0b96a8fca7b010c85fc44b4f89..3487d3ed8bda3e8136cba5878cb1805c12ad7770 100644 (file)
@@ -4,15 +4,9 @@
 static void
 test_init (void)
 {
-  GThread *self = g_thread_self ();
-
   g_assert (gtk_is_initialized () == FALSE);
-  g_assert (gtk_get_main_thread () == NULL);
-
   g_assert (gtk_init_check ());
   g_assert (gtk_is_initialized () == TRUE);
-
-  g_assert (gtk_get_main_thread () == self);
 }
 
 int